﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<IEnumerable<Model.Sys_Controllers>>"
    Theme="base" %>

<script runat="server">
    void Page_PreInit()
    {
        string t = "";

        if (Request.Cookies[User.Identity.Name + "Theme"] != null)
        {
            t = Request.Cookies[User.Identity.Name + "Theme"].Value;
        }

        if (Request.QueryString["Theme"] != null)
        {
            t = Request.QueryString["Theme"];
        }

        if (!string.IsNullOrEmpty(t))
        {
            Response.Cookies[User.Identity.Name + "Theme"].Value = t;
            Response.Cookies[User.Identity.Name + "Theme"].Expires = DateTime.Now.AddMonths(1);
            this.Page.Theme = t;
        }
    } 
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>
        <%:ViewData["Title"]%></title>
    <script src="/Scripts/jquery-1.4.4.min.js" type="text/javascript"></script>
    <script src="/Scripts/jquery.layout.1.2.0.min.js" type="text/javascript"></script>
    <script src="/Scripts/jquery.layout.1.2.0.min.setting.js" type="text/javascript"></script>
    <script src="/Scripts/jquery-ui.min.js" type="text/javascript"></script>
    <script src="/Scripts/jquery.unobtrusive-ajax.min.js" type="text/javascript"></script>
    <script src="/Scripts/jquery.validate.min.js" type="text/javascript"></script>
    <script src="/Scripts/jquery.validate.unobtrusive.min.js" type="text/javascript"></script>
    <script src="/Scripts/jquery.validate.min.js" type="text/javascript"></script>
    <script src="/Scripts/MicrosoftAjax.js" type="text/javascript"></script>
    <script src="/Scripts/MicrosoftMvcAjax.js" type="text/javascript"></script>
    <script src="/Scripts/MicrosoftMvcValidation.js" type="text/javascript"></script>
    <script src="/Scripts/jquery.cookie.js" type="text/javascript"></script>
    <script src="/ckeditor/ckeditor.js" type="text/javascript"></script>
    <script src="/ckeditor/adapters/jquery.js" type="text/javascript"></script>
    <script src="/scripts/jqueryuploadify/swfobject.js" type="text/javascript"></script>
    <script src="/scripts/jqueryuploadify/jquery.uploadify.v2.1.0.min.js" type="text/javascript"></script>
    <script src="/Scripts/JqueryUploadify/jquery.uploadify.v2.1.0.min-setting.js" type="text/javascript"></script>
    <link href="/Content/layout-default-latest.css" rel="stylesheet" type="text/css" />
    <link href="/Content/page.css" rel="stylesheet" type="text/css" />
    <link href="/Content/sexybuttons.css" rel="stylesheet" type="text/css" />
    <link href="/scripts/JqueryUploadify/uploadify.css" rel="stylesheet" type="text/css" />
    <link href="/Content/Site.css" rel="stylesheet" type="text/css" />
   
</head>
<body>
    <div id="dialog" title="系统消息">
    </div>
    <div id="systemstate" title="系统状态">
    </div>
    <div class="ui-layout-center ui-widget-content" id="Main">
        <%Html.RenderAction("Desktop"); %>
    </div>
    <div class="ui-layout-north  ui-widget-header">
        <div style="float: left;">
            <div style="font-size: 160%;">
                <%:ViewData["Title"]%></div>
            <div style="font-size: 120%;">
                <%: ViewData["Title1"]%></div>
        </div>
        <div style="float: right; margin: 10px;">
            <span id="Loading" class="ui-state-error">&nbsp; Loading... &nbsp;</span> <span id="datetimenow"
                style="cursor: pointer;"></span>&nbsp; 当前用户：<%=User.Identity.Name %>
            |
            <%=Ajax.ActionLink("桌面", "Desktop", new AjaxOptions() { LoadingElementId = "Loading", UpdateTargetId = "Main", OnFailure = "dialogOpen" })%>
            |
            <%=Ajax.ActionLink("主题", "Theme", new AjaxOptions() { LoadingElementId = "Loading", UpdateTargetId = "Main", OnFailure = "dialogOpen" })%>
            |
            <%=Ajax.ActionLink("密码", "Password", new AjaxOptions() { LoadingElementId = "Loading", UpdateTargetId = "Main", OnFailure = "dialogOpen", HttpMethod="Get" })%>
            |
            <%=Html.ActionLink("退出系统", "LogOff", "Account", new { area = "" },null)%>
        </div>
    </div>
    <div class="ui-layout-west  ui-widget-content">
        <div id="Menu_accordion">
            <%foreach (var item in Model as IQueryable<Model.Sys_Controllers>)
              {%>
            <div>
                <h3>
                    <a href="#">
                        <%=Html.Encode(item.DisplayName) %></a>
                </h3>
                <div>
                    <ul style="list-style: circle; margin: 0 16px;">
                        <%foreach (var item1 in item.Sys_Controllers1.Where(a => a.Enable && a.Sys_ActionsInControllersInRoles.Any(b => b.Sys_Roles.Sys_UsersInRoles.Any(c => c.Sys_Users.UserName.Equals(User.Identity.Name)))).OrderBy(a => a.IntOrder))
                          {%>
                        <li>
                            <%=Ajax.ActionLink(item1.DisplayName, "Index", item1.ControllerName, new AjaxOptions() { LoadingElementId = "Loading", UpdateTargetId = "Main", OnFailure = "dialogOpen" })%></li>
                        <%} %>
                    </ul>
                </div>
            </div>
            <%} %>
        </div>
    </div>
</body>
</html>
